﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model;
using Controller;

namespace Facade.Validator
{
    public class CategoryKPIValidator
    {
        public string ValidateOnSave(CategoryKPI Categories)
        {
            string msg = "OK";
            if (Categories.Description.Trim().Length <= 0)
                msg = "Please Enter Category KPI Description";
            if (Categories.GroupKPI  == null)
                msg = "Please Enter Group KPI";
            if (Categories.Sequence.ToString().Length<=0)
                msg = "Please Enter Order Row";

            return msg;
        }

        public string ValidateOnUpdate(CategoryKPI Categories)
        {
            string msg = "OK";
            if (Categories.Description.Trim().Length <= 0)
                msg = "Please Enter Category KPI Description";
            if (Categories.GroupKPI == null)
                msg = "Please Enter Group KPI";
            if (Categories.Sequence.ToString().Length <= 0)
                msg = "Please Enter Order Row";
            return msg;
        }
    }
}